package com.ruoyi.web.controller.inv;

import com.ruoyi.buy.domain.entity.buy0011.Buy0011TableData;
import com.ruoyi.buy.service.IBuy0009Service;
import com.ruoyi.buy.service.IInv0015Service;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 角色信息
 * 
 * @author ruoyi
 */
@RestController
@Transactional(rollbackFor = Exception.class)
@RequestMapping("/inv/inv0015")
public class inv0015Controller extends BaseController {
    @Autowired
    private IInv0015Service inv0015Service;


    /**
     * 查询库存信息列表
     */
    @GetMapping("/list")
    public TableDataInfo list(Buy0011TableData para)
    {
        startPage();
        List<Buy0011TableData> list = inv0015Service.getList(para);
        return getDataTable(list);
    }

    @PostMapping("/invTransform")
    public AjaxResult invTransform(@RequestBody Buy0011TableData para) throws Exception {
        this.inv0015Service.invTransform(para);
        return AjaxResult.success("操作成功");
    }

    /**
     * 处理完成提交回采购
     */
    @GetMapping(value = "/{id}")
    public AjaxResult handleToPurchase(@PathVariable("id") Long id)
    {
        this.inv0015Service.handleToPurchase(id);
        return AjaxResult.success("处理成功");
    }


}
